home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS01.ADF
/
ABasicStuff
/
Graphics
/
JPad.bas
< prev
next >
Wrap
BASIC Source File
|
1985-12-04
|
22KB
|
510 lines
10 ' jpad version 1.00 originally titled skpad
11 '
12 ' This program should give you an idea of the kinds of graphic
13 ' things you can do in ABASIC. Unfortunately this is not perfect
14 ' but it is FREE. Yes it's FREE. Please circulate.
15 '
16 ' Feel free to modify this program and put it backup on Compuserve.
17 '
18 ' This program will not save and load picture files correctly please
19 ' help me on this one. The disk menu is at 410 happy hacking.
20 '
21 ' jpad has no printer routine if you know how to do it please add it
22 '
23 'One other thing, this program eats memory! My amiga has the extra
24 ' 256k and I need more.
25 '
26 'That brings up a couple of real problems.
27 ' First cutting a full screen is not possible-memory constraints.
28 ' Second don't try to use screen top/bottom icons you'll get
29 ' an out of memory error.
30 '
31 ' Look for a lo-res version soon!
32 '
33 ' ******************************************************
34 '
35 'To use this program you need to point, click and sometimes drag.
36 '
37 'The choices from left to right on the screen are:
38 ' 16 color bars (far left)
39 ' active color /color register window
40 ' eraser/clear screen icon
41 ' brush/pens and brushes window icon
42 ' rubber band line icon
43 ' box outline icon
44 ' filled box icon
45 ' outline circle icon
46 ' filled circle icon
47 ' paint (roller) icon
48 ' cut (scissors) icon
49 ' paste (glue bottle) icon
50 ' and couple of empties for further mods
51 ' P / pattern window select icon
52 ' M / main menu icon (not much there, yet)
53 ' D / disk menu icon (buggy)
54 ' undo/don't undo icon (looks a diamond)
55 ' Q quit icon
56 '
57 ' skpad by Rick Schaeffer
58 ' and modified by Jack Russell [ 74706.2406 ]
59 ' as of 11-16-85
60 '
61 ' THIS IS PUBLIC DOMAIN
62 '
63 scnclr:graphic(1):ask window s1%,s2%:if s1%<330 then screen 1,4,0
64 dim undo%(16002):dim undid%(16002):dim za%(3):dim zb%(3):dim zc%(7)
65 dim edit%(9702):dim checker%(1):dim tile%(7):dim crust%(7)
66 dim zd%(1):dim ze%(3):dim zf%(7):dim zg%(3):dim zh%(3):dim zi%(7):dim zj%(7):dim zk%(7)
67 za%(0)=34952:za%(1)=17476:za%(2)=8738:za%(3)=4369
68 zb%(0)=4369:zb%(1)=8738:zb%(2)=17476:zb%(3)=34952
69 zc%(0)=34952:zc%(1)=17476:zc%(2)=8738:zc%(3)=4369:zc%(4)=4369:zc%(5)=8738:zc%(6)=17476:zc%(7)=34952
70 zd%(0)=34952:zd%(1)=34952:ze%(0)=39321:ze%(1)=52428:ze%(2)=26214:ze%(3)=13107
71 zf%(0)=13107:zf%(1)=771:zf%(2)=64379:zf%(3)=64379:zf%(4)=771:zf%(5)=12336:zf%(6)=47031:zf%(7)=47031
72 zg%(0)=0:zg%(1)=30583:zg%(2)=30583:zg%(3)=30583:zh%(0)=34952:zh%(1)=65535:zh%(2)=34952:zh%(3)=65535
73 zi%(0)=0:zi%(1)=16383:zi%(2)=16383:zi%(3)=15363:zi%(4)=15363:zi%(5)=15363:zi%(6)=15363:zi%(7)=16383
74 zj%(0)=4112:zj%(1)=10280:zj%(2)=21588:zj%(3)=43690:zj%(4)=21588:zj%(5)=10280:zj%(6)=4112:zj%(7)=0
75 zk%(0)=30598:zk%(1)=39064:zk%(2)=63736:zk%(3)=63736:zk%(4)=30598:zk%(5)=35209:zk%(6)=36751:zk%(7)=36751
76 checker%(0)=43690:checker%(1)=21845
77 tile%(0)=65280:tile%(1)=65280:tile%(2)=65280:tile%(3)=65280
78 tile%(4)=255:tile%(5)=255:tile%(6)=255:tile%(7)=255
79 crust%(0)=3084:crust%(1)=16131:crust%(2)=65472:crust%(3)=16176
80 crust%(4)=3084:crust%(5)=12351:crust%(6)=49407:crust%(7)=831
81 ppa%=4:ppb%=2:ppo%=1:doit%=2:old%=2:pin%=1:pat%=1
82 b%=bb%=bbn%=bl%=blm%=0
83 ca=cr=cx%=cy%=g%=gn%=i=jump%=0
84 r%=rn%=s1%=s2%=w4%=0
85 x%=y%=x1%=y1%=x2%=y2%=0
86 qx=0:z$=""
87 pena ppa%:penb ppb%:peno ppo%
88 pattern 0,tile%()
89 paste%=1:dm%=1:drawmode dm%
90 x1%=-1:y1%=-1
91 ' set-up screen --------------------------------------
92 gosub 231:gosub 269:gosub 271
93 ' ================main================================
94 ask mouse x%,y%,b%:if b%=4 then 94
95 gosub 269
96 ask mouse x%,y%,b%
97 x1%=x%:y1%=y%
98 if b%=0 then 96
99 if y%<11 and b%=4 and x%<160 then 100 else 104
100 ppa%=int(x%*.1)
101 if ppa%<0 then ppa%=0
102 gosub 275:outline 0:pattern 0,tile%():box(163,0;187,12),1:gosub 251:outline 1
103 goto 96
104 if y%>14 then 126
105 if x%>163 and x%<187 then 277
106 if x%>190 and x%<210 and b%=4 and doit%<>1 then doit%=1:goto 94
107 if x%>190 and x%<210 and b%=4 and doit%=1 then outline 1:pattern 0,tile%():box(0,14;617,186),1:gosub 251:goto 95
108 if x%>210 and x%<230 and b%=4 and doit%<>2 then doit%=2:goto 94 else if x%>210 and x%<230 and b%=4 then 312
109 if x%>230 and x%<250 and b%=4 then doit%=3:goto 95
110 if x%>250 and x%<270 and b%=4 then doit%=4:goto 95
111 if x%>270 and x%<290 and b%=4 then doit%=5:goto 95
112 if x%>290 and x%<310 and b%=4 then doit%=6:goto 95
113 if x%>310 and x%<330 and b%=4 then doit%=7:goto 95
114 if x%>330 and x%<350 and b%=4 then doit%=8:gosub 269:goto 96
115 if x%>350 and x%<370 and b%=4 then doit%=9:goto 95
116 if x%>370 and x%<390 and b%=4 then doit%=10:goto 95
117 if x%>410 and x%<430 and b%=4 then ? at (320,100)fre:goto 96
118 if x%>510 and x%<530 and b%=4 then 361
119 if x%>530 and x%<550 and b%=4 then 394
120 if x%>550 and x%<570 and b%=4 then 410
121 if x%>570 and x%<590 and b%=4 and undo<>1 then gosub 127:undo=1:goto 96
122 if x%>570 and x%<590 and b%=4 and undo=1 then gosub 128:undo=0:goto 96
123 if x%>590 and x%<610 and b%=4 then 434
124 if y%<14 then 96
125 ' stash screen and go --------------------------------
126 undo=0:sshape(0,0;640,200),undo%():goto 129
127 sshape(0,0;640,200),undid%():gshape (0,0), undo%():gosub 267:return
128 gshape(0,0),undid%():gosub 267:return
129 on doit% gosub 157,131,164,177,188,192,207,190,209,226:goto 96
130 ' use pen or brush ----------------------------------
131 outline 0:on pin% goto 132,133,134,135,136,137,138,139,140,141,142,143,144,147,152:return
132 draw(x1%,y1% to x%,y%):x1%=x%:y1%=y%:goto 153
133 area(x%,y% to x%+1,y% to x%+2,y%+1 to x%,y%+1 to x%,y%):goto 153
134 area(x%,y% to x%+6,y% to x%+6,y%+4 to x%,y%+4 to x%,y%):goto 153
135 area(x%,y% to x%+10,y% to x%+10,y%+6 to x%,y%+6 to x%,y%):goto 153
136 area(x%,y% to x%+10,y% to x%+10,y%+1 to x%,y%+1 to x%,y%):goto 153
137 area(x%,y% to x%+20,y% to x%+20,y%+1 to x%,y%+1 to x%,y%):goto 153
138 area(x%,y% to x% *.[ch] /* anything ending in .c or .h */
There are two routines:
First:
int iswild(p)
char *p; returns true if the string pointed to by p
contains *, ? or [
Second:
struct args
{
int argcount;
char **argvector;
} *ap,*expand();
struct args *expand(p)
char *p; returns a pointer to a structure as shown above
containing a list of all the matching names.
Note: the names may contain full paths but the
last specifier is file names only. e.g. if
you pass:
a/b/c/* this will work but none of
the directories in c will be found
a/b/*/* does not work!
These routines are available on object form only.
Good luck,
the folks at Tardis Software!
#endif
/* echox.c */
main(argc,argv)
int argc;
char **argv;
{
int i,j;
struct args
{
int argcount;
char **argvector;
} *ap,*expand();
i = 1;
while(--argc)
{
printf("argv[%d] = \"%s\"\n",i,argv[i]);
if (iswild(argv[i]))
{
ap = expand(argv[i]);
printf("ap -> argcount = %d\n",ap -> argcount);
printf("ap -> argvector = %x\n",ap->argvector);
for(j=0; j < ap ->argcount; j++)
printf("argvector[%d]=\"%s\"\n",j,ap->argvector[j]);
}
i++;
}
}
case 0x3F2: /* hunk_end */
if (debug)
printf("nxtsym= %d\n",nxtsym);
if (nxtsym)
putit(0xF0030000); /* 000003f0 in 8086 order */
for(i = 0; i < nxtsym; i++)
{
/* put out symtable record ? >